package com.flute.icrawler.framework.framework.container;

import java.io.Serializable;

public class ComparableFeature implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3547961593982385687L;
	private String name;
	private boolean reversal;
	private IStringValue value;

	public ComparableFeature(String name) {
		this.name = name;
		this.reversal = false;
	}

	public ComparableFeature(String name, IStringValue value) {
		this.name = name;
		this.value = value;
	}

	public ComparableFeature(String name, IStringValue value, boolean reversal) {
		this.name = name;
		this.value = value;
		this.reversal = reversal;
	}

	public ComparableFeature(String name, boolean reversal) {
		this.name = name;
		this.reversal = reversal;
	}

	public ComparableFeature newInstance(IStringValue value) {
		ComparableFeature cf = new ComparableFeature(name, value, reversal);

		return cf;
	}

	public ComparableFeature clone() {
		ComparableFeature cf = new ComparableFeature(name, value, reversal);
		return cf;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isReversal() {
		return reversal;
	}

	public void setReversal(boolean reversal) {
		this.reversal = reversal;
	}

	public IStringValue getValue() {
		return value;
	}

	public void setValue(IStringValue value) {
		this.value = value;
	}

	public String toString() {
		return name + ":" + value;
	}
}
